home *** CD-ROM | disk | FTP | other *** search
/ The Epic Collection / Epic Collection, The (Epic Marketing)(1996).iso / lsdtools / lsd120.dms / lsd120.adf / source / Huntwindows.s.pp / Huntwindows.s
Text File  |  1990-09-13  |  49KB  |  2,365 lines

  1.              output    work:huntwindows
  2.             OPT o+,ow-
  3.  
  4. DEBUG            equ    0
  5.             ;0=Debugging off, 1=Debugging on
  6.             ;no includes - i use them all preassembled!
  7.  
  8.             ;.... nearly all ....
  9.  
  10.             incdir    "asminc:"
  11.             include "workbench/startup.i"
  12.             include "workbench/workbench.i"
  13.             include    "workbench/icon_lib.i"
  14.             include    "libraries/commodities.i"
  15.             include    "graphics/view.i"
  16.  
  17.             ;Some helpful macros
  18. CALL            macro
  19.             jsr    _LVO\1(a6)
  20.             endm
  21. Push            macro
  22.             movem.l    \1,-(sp)
  23.             endm
  24. Pull            macro
  25.             movem.l    (sp)+,\1
  26.             endm
  27. RSave            macro
  28.             movem.l    a0-a6/d0-d7,-(sp)
  29.             endm
  30. RLoad            macro
  31.             movem.l    (sp)+,a0-a6/d0-d7
  32.             endm
  33.  
  34. MaxScreens        equ    64    ;Maximum of 64 Screens - who has more?
  35. ScreenMemSize        equ    MaxScreens*8    
  36.  
  37.         ;Bits for Communication
  38. SignalWindow        equ    0
  39. SignalScreen        equ    1
  40. SignalButton        equ    2
  41.  
  42.  
  43.  
  44. MyHotkeyID    =    1
  45. MyActionID    =    2
  46. MyCustomID    =    3
  47. MyLWinID    =    4
  48. MyNWinID    =    5
  49.  
  50.             RSave
  51.  
  52.             move.l    $04,a6
  53.             move.l    #AllocLength,d0
  54.             move.l    #MEMF_CLEAR,d1
  55.             CALL    AllocMem
  56.             move.l    d0,a4
  57.             tst.l    d0
  58.             beq    EndeRaus
  59.  
  60.             move.l    d0,RememberA4
  61.             move.l    a7,RememberStack
  62.  
  63.             lea    intuition(pc),a1
  64.             moveq.l    #37,d0
  65.             CALL    OpenLibrary
  66.             move.l    d0,IntBase(a4)
  67.             beq    Error2
  68.  
  69.             lea    DosName(pc),a1
  70.             moveq.l    #37,d0
  71.             CALL    OpenLibrary    
  72.             move.l    d0,DosBase(a4)
  73.             beq    Error2
  74.  
  75.             lea    GadName(pc),a1
  76.             moveq.l    #37,d0
  77.             CALL    OpenLibrary
  78.             move.l    d0,GadBase(a4)
  79.             beq    Error2
  80.  
  81.             lea    CommName(pc),a1
  82.             moveq.l    #37,d0
  83.             CALL    OpenLibrary
  84.             move.l    d0,CommBase(a4)
  85.             beq    Error2
  86.  
  87.             CALL    CreateMsgPort
  88.             move.l    d0,MouseMsgPort(a4)
  89.             beq    Error2
  90.  
  91.             move.l    #SIGBREAKF_CTRL_C,SignalMask(a4)
  92.  
  93.             move.l    d0,a0
  94.             move.l    #IOSTD_SIZE,d0
  95.             CALL    CreateIORequest
  96.             move.l    d0,MyIORequest(a4)
  97.             beq    Error2
  98.  
  99.             lea    InputName(pc),a0
  100.             moveq.l    #0,d0
  101.             move.l    MyIORequest(a4),a1
  102.             moveq.l    #0,d1
  103.             CALL    OpenDevice
  104.             tst.l    d0
  105.             bne    Error2
  106.  
  107.             lea    IconName(pc),a1
  108.             moveq.l    #33,d0
  109.             CALL    OpenLibrary
  110.             move.l    d0,IconBase(a4)
  111.             beq    Error2
  112.  
  113.             move.l    ThisTask(a6),a1
  114.             move.l    a1,OwnTask(a4)
  115.             tst.l    pr_CLI(a1)
  116.             bne    CliStart
  117.             lea    pr_MsgPort(a1),a2
  118.             move.l    a2,a0
  119.             CALL    WaitPort
  120.             move.l    a2,a0
  121.             CALL    GetMsg
  122.             move.l    d0,WBMessage(a4)
  123.             move.l    d0,a3
  124.         
  125.             move.l    sm_ArgList(a3),d7
  126.             beq    DisableSave
  127.             move.l    d7,a0
  128.             move.l    wa_Lock(a0),d1
  129.             move.l    DosBase(a4),a6
  130.             CALL    CurrentDir
  131.  
  132.             move.l    IconBase(a4),a6
  133.             move.l    d7,a0
  134.             move.l    wa_Name(a0),a0
  135.             CALL    GetDiskObject
  136.             move.l    d0,DObject(a4)
  137.             beq    Error2
  138.  
  139.             lea    WBTemplate(pc),a3
  140.  
  141.             move.l    d0,a0
  142.             move.l    do_ToolTypes(a0),a0
  143.             
  144. GetEmLoop        tst.l    (a3)
  145.             beq.s    FreeDobj
  146.             move.l    TemplateText(a3),a1
  147.             beq.s    FreeDobj
  148.             move.l    a0,-(sp)
  149.             CALL    FindToolType
  150.             move.l    (sp)+,a0
  151.             sub.l    a2,a2
  152.             move.w    TemplateA4(a3),a2
  153.             add.l    a4,a2
  154.             move.l    d0,(a2)
  155.             add.l    #TemplateSize,a3
  156.             bra.s    GetEmLoop
  157.  
  158. FreeDobj        bsr    BuildPatterns
  159.  
  160.             bra.s    SkipReadArgs
  161.  
  162. CliStart        move.l    DosBase(a4),a6
  163.  
  164.             move.l    #Template,d1
  165.             lea    TemplateArray(a4),a0
  166.             move.l    a0,d2
  167.             moveq.l    #0,d3
  168.             CALL    ReadArgs    ;Get options
  169.             tst.l    d0
  170.             beq    Error2
  171.             move.l    d0,Args(a4)
  172.     
  173.             bsr    BuildPatterns
  174.  
  175. DisableSave        move.l    #1,TempSave(a4)
  176.  
  177. SkipReadArgs        move.l    $04,a6
  178.             lea    GraphicsName(pc),a1
  179.             moveq.l    #36,d0
  180.             CALL    OpenLibrary
  181.             move.l    d0,GraphicsBase(a4)
  182.             beq    Error2
  183.  
  184.             tst.l    TempHADJ(a4)
  185.             beq    GotIt1
  186.             move.l    TempHADJ(a4),a0
  187.             bsr    GetNexta0
  188.             clr.l    TempHADJ(a4)
  189.             cmp.b    #"l",d0
  190.             beq.s    GotIt1
  191.             add.l    #1,TempHADJ(a4)
  192.             cmp.b    #"r",d0
  193.             beq.s    GotIt1
  194.             add.l    #1,TempHADJ(a4)
  195.             cmp.b    #"c",d0
  196.             beq.s    GotIt1
  197.             add.l    #1,TempHADJ(a4)
  198.  
  199. GotIt1            tst.l    TempVADJ(a4)
  200.             beq    GotIt2
  201.             move.l    TempVADJ(a4),a0
  202.             bsr    GetNexta0
  203.             clr.l    TempVADJ(a4)
  204.             cmp.b    #"t",d0
  205.             beq.s    GotIt2
  206.             add.l    #1,TempVADJ(a4)
  207.             cmp.b    #"b",d0
  208.             beq.s    GotIt2
  209.             add.l    #1,TempVADJ(a4)
  210.             cmp.b    #"c",d0
  211.             beq.s    GotIt2
  212.             add.l    #1,TempVADJ(a4)
  213.  
  214. GotIt2            tst.l    TempAction(a4)
  215.             beq    GotIt3
  216.             move.l    TempAction(a4),a0
  217.             bsr    GetNexta0
  218.             clr.l    TempAction(a4)
  219.             cmp.b    #"n",d0
  220.             beq.s    GotIt3
  221.             add.l    #1,TempAction(a4)
  222.             cmp.b    #"h",d0
  223.             beq.s    GotIt3
  224.             add.l    #1,TempAction(a4)
  225.  
  226. GotIt3            tst.l    TempCXPRI(a4)
  227.             beq.s    GotIt3_1
  228.             move.l    TempCXPRI(a4),a0
  229.             bsr    GetNexta0
  230.             bsr    GetInteger
  231.             move.l    d0,TempCXPRI(a4)
  232.             move.b    d0,MyPri
  233.  
  234. GotIt3_1        tst.l    TempDelay(a4)
  235.             beq.s    GotIt4
  236.             move.l    TempDelay(a4),a0
  237.             bsr    GetNexta0
  238.             bsr    GetInteger
  239.             tst.l    d0
  240.             bmi.s    GotIt4
  241.             cmp.l    #100,d0
  242.             bgt.s    GotIt4
  243.             move.l    d0,TempDelay(a4)
  244.  
  245. GotIt4            move.l    $04,a6
  246.             CALL    CreateMsgPort
  247.             move.l    d0,BrokerPort
  248.             move.l    d0,MyPort(a4)
  249.             move.l    d0,a0
  250.             move.b    MP_SIGBIT(a0),d0
  251.             move.l    SignalMask(a4),d1    ;Enter signal into
  252.             bset    d0,d1            ;mask for waiting
  253.             move.l    d1,SignalMask(a4)
  254.  
  255.             move.l    CommBase(a4),a6
  256.             lea    MyNewBroker(pc),a0
  257.             clr.l    d0
  258.             CALL    CxBroker
  259.             tst.l    d0
  260.             beq    QuitPrg
  261.             move.l    d0,Broker(a4)
  262.  
  263.             move.l    d0,a0
  264.             moveq.l    #1,d0
  265.             CALL    ActivateCxObj
  266.             
  267.             ;Install Handler for Mouse_Button_test
  268.  
  269.             move.l    #CX_CUSTOM,d0
  270.             lea    TestButton(pc),a0    ;My Program
  271.             move.l    #MyCustomID,a1        ;ID
  272.             CALL    CreateCxObj
  273.             move.l    d0,a1
  274.             tst.l    d0
  275.             beq    QuitPrg
  276.             move.l    Broker(a4),a0
  277.             CALL    AttachCxObj
  278.  
  279.             bsr    InstallHotKey
  280.  
  281.             move.l    $04,a6
  282.                     moveq   #-1,d0            ;A Signal for telling
  283.                     jsr     _LVOAllocSignal(a6)    ;our task that sth happened
  284.                     tst.l   d0
  285.                     bmi     Error2
  286.                     move.l  d0,Signal(a4)
  287.             move.l    SignalMask(a4),d1
  288.                     bset    d0,d1
  289.                     move.l    d1,SignalMask(a4)
  290.  
  291.             lea    MyInterrupt(a4),a1
  292.             move.l    #Interrupt3,IS_CODE(a1)
  293.             clr.l    IS_DATA(a1)
  294.             move.b    #NT_INTERRUPT,LN_TYPE(a1)
  295.             move.b    #0,LN_PRI(a1)
  296.             move.l    #HandlerName,LN_NAME(a1)
  297.             move.l    #5,d0            ;INTB_VERTB
  298.             jsr    _LVOAddIntServer(a6)
  299.  
  300.             tst.l    TempCXPOPUP(a4)
  301.             beq.s    WaitOn
  302.             bsr    OpenGUI
  303.  
  304. WaitOn            tst.w    QuitMe(a4)
  305.             bne    QuitPrg
  306.             move.l    $04,a6
  307.             move.l    SignalMask(a4),d0    ;Wait for Port and Break
  308.             CALL    Wait
  309.             btst    #SIGBREAKB_CTRL_C,d0    ;This means quit
  310.             bne    QuitPrg
  311.             move.l    Signal(a4),d1
  312.             btst    d1,d0            ;Signal from Interrupt?
  313.             beq.s    TryNextMsg
  314.  
  315.             tst.w    DisableHW(a4)
  316.             bne.s    TryNextMsg        ;Do nothing
  317.  
  318.             tst.l    TempDelay(a4)
  319.             beq.s    NoDelay
  320.             tst.w    GUIOpened(a4)
  321.             bne    NoDelay    ;Not with GUI opened
  322.  
  323. ReDelay            clr.w    DelayDo(a4)
  324.             move.l    DosBase(a4),a6
  325.             move.l    TempDelay(a4),d1    ;Microseconds
  326.             CALL    Delay
  327.             tst.w    DelayDo(a4)    ;Something happened again
  328.             bne.s    ReDelay        ;so wait till things calmed down
  329.             move.l    $04,a6
  330.  
  331. NoDelay            tst.w    ButtonPressed(a4)
  332.             bne.s    TryNextMsg        ;Omit that stuff for now
  333.             bclr    #SignalButton,What(a4)    ;We will get a signal when
  334.                             ;the button will be released
  335.  
  336.             cmp.l    #1,TempAction(a4)    ;Only do it on Hotkey
  337.             beq.s    TryNextMsg
  338.  
  339. OnHotKey        btst    #SignalWindow,What(a4)
  340.             beq.s    NoWindowStuff
  341.             
  342.             bsr    DoYourJob
  343.             bclr    #SignalWindow,What(a4)
  344.  
  345. NoWindowStuff        btst    #SignalScreen,What(a4)
  346.             beq.s    TryNextMsg
  347.             bsr    AdjustScreen
  348.             bclr    #SignalScreen,What(a4)
  349.  
  350. TryNextMsg        move.l    $04,a6
  351.             move.l    MyPort(a4),a0        ;Get the message awaiting
  352.             CALL    GetMsg
  353.             tst.l    d0
  354.             bne.s    GotMsg
  355.             bsr    CheckGUI
  356.             bra    WaitOn
  357.  
  358. GotMsg            move.l    d0,a3
  359.             move.l    d0,a0
  360.             move.l    CommBase(a4),a6
  361.             CALL    CxMsgType
  362.             move.l    d0,d6
  363.             move.l    a3,a0
  364.             CALL    CxMsgID
  365.             move.l    d0,d5
  366.             move.l    a3,a1
  367.             move.l    $04,a6
  368.             CALL    ReplyMsg
  369.             cmp.w    #CXM_IEVENT,d6
  370.             bne    OtherCommand
  371.             cmp.l    #MyActionID,d5
  372.             beq.s    NotGUIKey
  373.             cmp.l    #MyLWinID,d5
  374.             beq.s    ActivateLWIN
  375.             cmp.l    #MyNWinID,d5
  376.             beq.s    ActivateNWIN
  377.             bsr    OpenGUI
  378.             bra    OtherCommand
  379. NotGUIKey        bset    #SignalWindow,What(a4)
  380.             bset    #SignalScreen,What(a4)
  381.             bra    OnHotKey
  382.  
  383. ActivateLWIN        move.l    IntBase(a4),a6
  384.             clr.l    d0
  385.             CALL    LockIBase
  386.             move.l    d0,IBaseLock(a4)
  387.  
  388.             move.l    LastActive(a4),a3
  389.             move.l    a3,d0
  390.             beq.s    SkipLWin
  391.  
  392. LikeLWin        bsr    TestWindowPattern
  393.             bmi.s    OkiPattern
  394.  
  395.             tst.l    d7
  396.             bne.s    RepeatDo
  397.             move.l    a3,d7    ;Remember startwindow to prevent loop!
  398.             bra.s    NoRepeat
  399.  
  400. RepeatDo        cmp.l    a3,d7
  401.             beq    SkipLWin    ;Repeat! All windows used!
  402. NoRepeat        move.l    a3,a0
  403.             cmp.l    #MyNWinID,d5
  404.             beq.s    ActivateNWIN2
  405.             bra.s    SkipLWin
  406.             
  407. OkiPattern        move.l    wd_WScreen(a3),a0
  408.             bsr    TestWindowOnScreen
  409.             tst.l    d0
  410.             beq    SkipLWin
  411.  
  412.             move.l    a3,a0
  413.             CALL    ActivateWindow
  414.  
  415. SkipLWin        move.l    IBaseLock(a4),a0
  416.             CALL    UnlockIBase
  417.             bra    OnHotKey
  418.  
  419. ActivateNWIN        move.l    IntBase(a4),a6
  420.             clr.l    d0
  421.             CALL    LockIBase
  422.             move.l    d0,IBaseLock(a4)
  423.  
  424.             move.l    Active(a4),a0
  425.             move.l    a0,d0
  426.             beq    SkipLWin
  427.             clr.l    d7
  428. ActivateNWIN2        move.l    wd_NextWindow(a0),a3
  429.             move.l    a3,d0
  430.             bne.s    LikeLWin
  431.             move.l    ib_FirstScreen(a6),a0
  432.             move.l    a0,d0
  433.             beq    SkipLWin
  434.             move.l    sc_FirstWindow(a0),a3
  435.             move.l    a3,d0
  436.             bne.s    LikeLWin
  437.             bra.s    SkipLWin
  438.  
  439. OtherCommand        cmp.w    #CXM_COMMAND,d6
  440.             bne    WaitOn
  441.  
  442.             cmp.w    #CXCMD_DISABLE,d5
  443.             bne.s    OtherI1
  444.             move.w    #1,DisableHW(a4)
  445.  
  446. OtherI1            cmp.w    #CXCMD_ENABLE,d5
  447.             bne.s    OtherI2
  448.             clr.w    DisableHW(a4)
  449.  
  450. OtherI2            cmp.w    #CXCMD_UNIQUE,d5
  451.             beq.s    OtherII
  452.             cmp.w    #CXCMD_APPEAR,d5
  453.             bne.s    OtherI3
  454. OtherII            bsr    OpenGUI
  455.  
  456. OtherI3            cmp.w    #CXCMD_DISAPPEAR,d5
  457.             bne.s    OtherI4
  458.             bsr    CloseGUI
  459.  
  460. OtherI4            cmp.w    #CXCMD_KILL,d5
  461.             beq    QuitPrg
  462.  
  463.             bra    TryNextMsg
  464.  
  465. Error2            lea    Text1(pc),a0        ;Seems there is an error
  466.             bsr    OpenRequester        ;in the given arguments
  467.             bra.s    QuitPrg
  468.  
  469. EndeRaus2        lea    Text2(pc),a0        ;Wrong Kickstart
  470.             bsr    PrintText
  471.  
  472. QuitPrg            move.l    RememberStack,a7
  473.             bsr    CloseGUI
  474.             move.l    $04,a6    
  475.             move.l    #5,d0
  476.             lea    MyInterrupt(a4),a1
  477.             tst.l    IS_CODE(a1)
  478.             beq.s    NoHandler
  479.             CALL    RemIntServer        ;Remove the Interrupt-Server
  480.  
  481. NoHandler        tst.l    MyIORequest(a4)
  482.             beq.s    NoDevIO
  483.             move.l    MyIORequest(a4),a1
  484.             CALL    CloseDevice
  485.             move.l    MyIORequest(a4),a0
  486.             CALL    DeleteIORequest    
  487. NoDevIO            tst.l    MouseMsgPort(a4)
  488.             beq.s    NoMouseMsg
  489.  
  490.             move.l    MouseMsgPort(a4),a0
  491.             bsr    CloseMsgPort
  492.  
  493. NoMouseMsg        move.l    IconBase(a4),a6
  494.             tst.l    DObject(a4)
  495.             beq.s    SkipFreeDobj
  496.             move.l    DObject(a4),a0
  497.             CALL    FreeDiskObject
  498.  
  499. SkipFreeDobj        move.l    $04,a6
  500.             move.l    Signal(a4),d0        ;Free the signal
  501.             beq.s    DontFreeS
  502.                     CALL    FreeSignal
  503.  
  504. DontFreeS        tst.l    Args(a4)
  505.             beq.s    HmmNoArgs
  506.             move.l    DosBase(a4),a6
  507.             move.l    Args(a4),d1
  508.             CALL    FreeArgs
  509.  
  510. HmmNoArgs        move.l    #Filter,d5
  511.             bsr    RemovePopKey
  512.             move.l    #Filter2,d5
  513.             bsr    RemovePopKey
  514.  
  515.             tst.l    Broker(a4)
  516.             beq.s    NoCX
  517.             move.l    CommBase(a4),a6
  518.             move.l    Broker(a4),a0
  519.             CALL    DeleteCxObjAll
  520.  
  521. NoCX            move.l    $04,a6
  522.             tst.l    MyPort(a4)
  523.             beq.s    NoPort
  524.             move.l    MyPort(a4),a0
  525.             bsr    CloseMsgPort
  526.  
  527. NoPort            move.l    IntBase(a4),d0        ;Close librarys
  528.             beq.s    ErrorX2
  529.             move.l    d0,a1
  530.             CALL    CloseLibrary
  531.  
  532. ErrorX2            move.l    GraphicsBase(a4),d0
  533.             beq.s    ErrorX1
  534.             move.l    d0,a1
  535.             CALL    CloseLibrary
  536.  
  537. ErrorX1            move.l    IconBase(a4),d0
  538.             beq.s    NoIconLib
  539.             move.l    d0,a1
  540.             CALL    CloseLibrary
  541.             
  542. NoIconLib        move.l    CommBase(a4),d0
  543.             beq.s    NoCommLib
  544.             move.l    d0,a1
  545.             CALL    CloseLibrary
  546.  
  547. NoCommLib        move.l    GadBase(a4),d0
  548.             beq.s    OnlyDOS
  549.             move.l    d0,a1
  550.             CALL    CloseLibrary
  551.  
  552. OnlyDOS            move.l    DosBase(a4),d0
  553.             beq.s    FreeOnly
  554.             move.l    d0,a1
  555.             CALL    CloseLibrary
  556.  
  557. FreeOnly        move.l    ScreenPatLen(a4),d0
  558.             beq.s    NoScreenPat
  559.             move.l    ScreenPattern(a4),a1
  560.             CALL    FreeMem
  561.  
  562. NoScreenPat        move.l    WindowPatLen(a4),d0
  563.             beq.s    NoWindowPat
  564.             move.l    WindowPattern(a4),a1
  565.             CALL    FreeMem
  566.  
  567. NoWindowPat        move.l    WBMessage(a4),d7
  568.             move.l    a4,a1
  569.             move.l    #AllocLength,d0
  570.             CALL    FreeMem            
  571.  
  572.             move.l    d7,a1
  573.             tst.l    d7
  574.             beq.s    EndeRaus
  575.             CALL    Forbid
  576.             CALL    ReplyMsg
  577.  
  578. EndeRaus        RLoad
  579.             moveq.l    #0,d0
  580.             rts
  581.  
  582. CloseMsgPort        move.l    a0,a3
  583. ClosePortRout        move.l    a3,a0
  584.             CALL    GetMsg
  585.             tst.l    d0
  586.             beq.s    NoMsgLeft
  587.             move.l    d0,a1
  588.             CALL    ReplyMsg
  589.             bra.s    ClosePortRout
  590. NoMsgLeft        move.l    a3,a0
  591.             CALL    DeleteMsgPort        ;and free it
  592.             rts
  593.  
  594.  
  595.             ;Subroutine to print a text to stdout
  596. PrintText        Push    d0-d4/a0-a1/a6
  597.             move.l    a0,a1
  598.             moveq.l    #0,d0
  599. TestLen            tst.b    (a1)+
  600.             beq.s    LaengeOk
  601.             addq    #1,d0
  602.             bra.s    TestLen
  603. LaengeOk        move.l    $04,a6
  604.             lea    DosName(pc),a1
  605.             moveq.l    #0,d0
  606.             CALL    OpenLibrary    
  607.             move.l    d0,DosBase(a4)
  608.             beq    SkipWrite
  609.             move.l    d0,a6
  610.             move.l    a0,d2
  611.             move.l    d0,d3
  612.             CALL    Output
  613.             move.l    d0,d1
  614.             beq.s    SkipWrite
  615.             CALL    Write
  616. SkipWrite        Pull    d0-d4/a0-a1/a6
  617.             rts
  618.  
  619.             ;MainPart: does the scrolling if necessary
  620. DoYourJob        RSave
  621.             move.l    IntBase(a4),a6
  622.             clr.l    d0
  623.             CALL    LockIBase
  624.             move.l    d0,IBaseLock(a4)
  625.  
  626.             move.l    ib_ActiveWindow(a6),d0
  627.             beq    LeaveIt
  628.             move.l    d0,a5
  629.  
  630.             move.l    wd_WScreen(a5),d0
  631.             beq    LeaveIt
  632.             move.l    d0,a3
  633.             
  634.             move.l    DosBase(a4),a6
  635.  
  636.             tst.l    TempRestrict(a4)
  637.             bne.s    NoMatter2
  638.  
  639.             tst.b    ScreenPatternMem(a4)
  640.             beq.s    NoMatter2
  641.             move.l    ScreenPattern(a4),d1
  642.             move.l    sc_DefaultTitle(a3),d2
  643.             CALL    MatchPatternNoCase
  644.             beq    LeaveIt
  645.  
  646. NoMatter2        move.l    a5,d0
  647.             bsr    TestWindowPattern
  648.             beq    LeaveIt
  649.  
  650. NoMatter3        bsr    RememberWindow
  651.  
  652.             move.l    GraphicsBase(a4),a6    ;Get the visible size
  653.             lea    sc_ViewPort(a3),a0    ;of the screen to
  654.             move.l    vp_ColorMap(a0),a0
  655.  
  656.             ;Taglist on Stack (because it gets changed)
  657.             move.l    #TAG_DONE,-(sp)
  658.             clr.l    -(sp)
  659.             move.l    #VTAG_VIEWPORTEXTRA_GET,-(sp)
  660.             move.l    a7,a1
  661.  
  662.             CALL    VideoControl
  663.             tst.l    d0
  664.             bne    LeaveIt
  665.             movem.l    (sp)+,d0-d2    ;Get Taglist from Stack
  666.             move.l    d1,a0        ;In the middle is our data
  667.             lea    vpe_DisplayClip(a0),a0 ;extra
  668.  
  669.             move.w    ra_MaxX(a0),d0
  670.             sub.w    ra_MinX(a0),d0
  671.             addq    #1,d0
  672.             move.w    d0,VisualX(a4)
  673.             move.w    sc_LeftEdge(a3),d0
  674.             sub.w    ra_MinX(a0),d0
  675.             move.w    d0,PositionX(a4)
  676.  
  677.             move.w    ra_MaxY(a0),d0
  678.             sub.w    ra_MinY(a0),d0
  679.             addq    #1,d0
  680.             move.w    d0,VisualY(a4)
  681.             move.w    sc_TopEdge(a3),d0
  682.             sub.w    ra_MinY(a0),d0
  683.             move.w    d0,PositionY(a4)
  684.  
  685.             move.l    IntBase(a4),a6
  686.             tst.l    TempSFront(a4)        ;do we want screentofront?
  687.             beq.s    NoFront
  688.             cmp.l    ib_FirstScreen(a6),a3
  689.             beq.s    NoFront            ;Not necessary (optimize!)
  690.  
  691.             bsr    UnlockIt
  692.             move.l    a3,a0
  693.             CALL    ScreenToFront
  694.             bset    #SignalScreen,What(a4)    ;ScreenChange!
  695.             bsr    RelockAndTest
  696.  
  697. NoFront            move.l    wd_Flags(a5),d0
  698.             and.l    #WFLG_BACKDROP,d0
  699.             bne    LeaveIt            ;Not with backdrops!
  700.  
  701.             tst.l    TempWFront(a4)        ;do we WindowToFront() ?
  702.             beq.s    NoFront2
  703.             
  704.             bsr    UnlockIt
  705.             move.l    a5,a0
  706.             CALL    WindowToFront
  707.             bsr    RelockAndTest
  708.  
  709. NoFront2        tst.l    TempMove(a4)
  710.             beq    LeaveIt
  711.  
  712.             move.l    wd_WScreen(a5),a0    
  713.  
  714.             ;Calculate how the window is located towards the view
  715.             
  716.             move.w    wd_LeftEdge(a5),d0
  717.             add.w    PositionX(a4),d0
  718.             move.w    wd_LeftEdge(a5),d1
  719.             add.w    wd_Width(a5),d1
  720.             move.w    PositionX(a4),d7
  721.             sub.w    VisualX(a4),d7
  722.             add.w    d7,d1
  723.             move.w    wd_TopEdge(a5),d2
  724.             add.w    PositionY(a4),d2
  725.             move.w    wd_TopEdge(a5),d3
  726.             add.w    wd_Height(a5),d3
  727.             move.w    PositionY(a4),d7
  728.             sub.w    VisualY(a4),d7
  729.             add.w    d7,d3
  730.             
  731.             ;d0: Pixels out left border (out = negative)
  732.             ;d1: Pixels out right border (out = positive)
  733.             ;d2: Pixels out top border (out = negative)
  734.             ;d3: Pixels out bottom border (out = positive)
  735.             ;For scrolling all these Values have to be negated
  736.  
  737.             ;Horizontal Section
  738.             
  739.  
  740.             cmp.l    #2,TempAction(a4)    ;Always
  741.             beq.s    HScrollNeeded
  742.  
  743.             tst.w    d0
  744.             bmi.s    HScrollNeeded
  745.             tst.w    d1
  746.             bmi.s    NoHScrollNeeded
  747.  
  748. HScrollNeeded        cmp.l    #2,TempHADJ(a4)
  749.             bne.s    HNoCenter
  750.  
  751.             ;Center Window
  752.  
  753.             move.w    d0,d4
  754.             add.w    d1,d4
  755.             asr.w    #1,d4    ;CenterScrollValue
  756.             bra.s    HDone
  757.  
  758. HNoCenter        cmp.l    #1,TempHADJ(a4)
  759.             bne.s    HNoRight
  760.  
  761.             ;Adjust Window to Right Border
  762.  
  763.             move.w    d1,d4
  764.             bra.s    HDone
  765.  
  766. HNoRight        tst.l    TempHADJ(a4)
  767.             bne.s    HNoLeft
  768.  
  769.             ;Adjust Window to Left Border
  770.  
  771.             move.w    d0,d4
  772.             bra.s    HDone
  773.  
  774. HNoLeft            ;Optimized Adjustment
  775.             ;When coming here it is shure that at least ONE scroll
  776.             ;is necessary!!!
  777.             tst.w    d0
  778.             beq.s    THScroll
  779.             bpl.s    NoHScroll1
  780.             move.w    d0,d4
  781.  
  782. THScroll        tst.w    d1
  783.             bmi.s    HDone        ;Has to be for normal windows
  784.             ;This means the window leaps out BOTH borders!
  785.             ;Then we do NOTHING
  786.             bra.s    NoHScrollNeeded
  787.  
  788. NoHScroll1        move.w    d1,d4
  789.             bra.s    HDone
  790.  
  791. NoHScrollNeeded        moveq.l    #0,d4
  792.  
  793. HDone            ext.l    d4
  794.             neg.l    d4
  795.  
  796.             ;The Vertical section works almost equally
  797.  
  798.             cmp.l    #2,TempAction(a4)    ;Always
  799.             beq.s    VScrollNeeded
  800.  
  801.             tst.w    d2
  802.             bmi.s    VScrollNeeded
  803.             tst.w    d3
  804.             bmi.s    NoVScrollNeeded
  805.  
  806. VScrollNeeded        cmp.l    #2,TempVADJ(a4)
  807.             bne.s    VNoCenter
  808.  
  809.             ;Center Window
  810.  
  811.             move.w    d2,d5
  812.             add.w    d3,d5
  813.             asr.w    #1,d5    ;CenterScrollValue
  814.             bra.s    VDone
  815.  
  816. VNoCenter        cmp.l    #1,TempVADJ(a4)
  817.             bne.s    VNoBottom
  818.  
  819.             ;Adjust Window to Bottom Border
  820.  
  821.             move.w    d3,d5
  822.             bra.s    VDone
  823.  
  824. VNoBottom        tst.l    TempVADJ(a4)
  825.             bne.s    VNoTop
  826.  
  827.             ;Adjust Window to Top Border
  828.  
  829.             move.w    d2,d5
  830.             bra.s    VDone
  831.  
  832. VNoTop            ;Optimized Adjustment
  833.             ;When coming here it is shure that at least ONE scroll
  834.             ;is necessary!!!
  835.             tst.w    d2
  836.             beq    TVScroll
  837.             bpl.s    NoVScroll1
  838.             move.w    d2,d5
  839.  
  840. TVScroll        tst.w    d3
  841.             bmi.s    VDone        ;Has to be for normal windows
  842.             ;This means the window leaps out BOTH borders!
  843.             ;Then we do NOTHING
  844.             bra.s    NoVScrollNeeded
  845.  
  846. NoVScroll1        move.w    d3,d5
  847.             bra.s    VDone
  848.  
  849. NoVScrollNeeded        moveq.l    #0,d5
  850.  
  851. VDone            ext.l    d5
  852.             neg.l    d5
  853.  
  854.             move.l    d4,d0
  855.             move.l    d5,d1
  856.  
  857.             move.w    PositionY(a4),d4    ;Prevent dragging a screen
  858.             neg.w    d4            ;further down than at Pos 0
  859.             sub.w    d1,d4
  860.             bpl.s    NoOutRange
  861.             tst.w    d1            ;Screen already down a bit:
  862.             bmi.s    NoOutRange        ;If move up, then ok,
  863.             clr.l    d1            ;otherwise no move at all
  864.             ;move.w    PositionY(a4),d1    ;was: pull to top, if pulled
  865.             ;neg.w    d1            ;down at all.
  866.  
  867. NoOutRange        move.w    sc_TopEdge(a0),d5
  868.             move.w    sc_LeftEdge(a0),d6
  869.  
  870.             bsr    UnlockIt
  871.             Push    a0-a1/d0-d4
  872.             CALL    MoveScreen
  873.             clr.l    d0
  874.             CALL    LockIBase        ;relock - no test window!
  875.             move.l    d0,IBaseLock(a4)
  876.             Pull    a0-a1/d0-d4
  877.  
  878.             sub.w    sc_TopEdge(a0),d5    ;Find out how far the
  879.             sub.w    sc_LeftEdge(a0),d6    ;screen really moves
  880.             move.l    d6,d0
  881.             move.l    d5,d1
  882.             neg.l    d0
  883.             neg.l    d1
  884.  
  885.             tst.l    TempMoveMouse(a4)
  886.             beq.s    LeaveIt
  887.  
  888.             ;If a window becomes active without clicking, the Mouse
  889.             ;can be out of range, and moving it would scroll the
  890.             ;Screen back, so we check this here and disable movement
  891.             ;if "dangerous"
  892.             move.w    sc_MouseX(a0),d2
  893.             add.w    sc_LeftEdge(a0),d2
  894.             add.w    d0,d2            ;Movement in X
  895.             bmi.s    ClearXMovement
  896.             cmp.w    VisualX(a4),d2
  897.             bcs.s    LeaveXMovement
  898. ClearXMovement        moveq.l    #0,d0
  899. LeaveXMovement        move.w    sc_MouseY(a0),d2
  900.             add.w    sc_TopEdge(a0),d2
  901.             add.w    d1,d2            ;Movement in Y
  902.             bmi.s    ClearYMovement
  903.             cmp.w    VisualY(a4),d2
  904.             bcs.s    LeaveYMoveMent
  905. ClearYMovement        moveq.l    #0,d1
  906. LeaveYMoveMent        bsr    UnlockIt
  907.             tst.w    d0
  908.             bne.s    SetIt
  909.             tst.w    d1
  910.             beq.s    LeaveItReal
  911. SetIt            bsr    SetPointer
  912. LeaveItReal        RLoad
  913.             rts
  914.  
  915. LeaveIt            move.l    IntBase(a4),a6
  916.             move.l    IBaseLock(a4),a0
  917.             CALL    UnlockIBase
  918.             bra.s    LeaveItReal
  919.  
  920. UnlockIt        Push    a0-a1/d0-d1
  921.             move.l    IBaseLock(a4),a0
  922.             CALL    UnlockIBase
  923.             Pull    a0-a1/d0-d1
  924.             rts
  925.  
  926. RelockAndTest        Push    a0-a1/d0-d1
  927.             move.l    IntBase(a4),a6
  928.             clr.l    d0
  929.             CALL    LockIBase
  930.             move.l    d0,IBaseLock(a4)
  931.  
  932.             move.l    ib_ActiveWindow(a6),d0
  933.             beq.s    TestFailed
  934.             cmp.l    d0,a5
  935.             bne.s    TestFailed
  936.  
  937.             move.l    wd_WScreen(a5),d0
  938.             beq.s    TestFailed
  939.             cmp.l    d0,a3
  940.             bne.s    TestFailed
  941.             Pull    a0-a1/d0-d1
  942.             rts
  943.  
  944. TestFailed        Pull    a0-a1/d0-d1
  945.             tst.l    (sp)+    ;rts
  946.             ;Window or Screen changed while we had Ibase unlocked
  947.             ;=> leave
  948.             bra.s    LeaveIt
  949.  
  950. AdjustScreen        RSave                
  951.             move.l    IntBase(a4),a6
  952.             clr.l    d0
  953.             CALL    LockIBase
  954.             move.l    d0,d7
  955.             move.l    ib_FirstScreen(a6),d0
  956.             beq    SkipActive
  957.  
  958.             move.l    d0,a3
  959.             tst.b    ScreenPatternMem(a4)
  960.             beq.s    NoMatter5
  961.             move.l    ScreenPattern(a4),d1
  962.             move.l    sc_DefaultTitle(a3),d2
  963.             move.l    DosBase(a4),a6
  964.             CALL    MatchPatternNoCase
  965.             bne.s    NoMatter5
  966.  
  967.             tst.l    TempRestrict(a4)
  968.             bne.s    Skip_NoPub2
  969.  
  970.             bra    SkipActive
  971.  
  972. NoMatter5        tst.l    TempPDef(a4)    ;Enter FirstScreen as Default
  973.                         ;PublicScreen ?
  974.             beq.s    Skip_NoPub2
  975.             move.l    d7,a0
  976.             move.l    IntBase(a4),a6
  977.             CALL    UnlockIBase
  978.  
  979.             CALL    LockPubScreenList
  980.  
  981. CarryListOn        move.l    d0,a0
  982.             cmp.l    psn_Screen(a0),a3
  983.             beq.s    ScreenFound
  984.             move.l    LN_SUCC(a0),d0
  985.             bne.s    CarryListOn
  986.             CALL    UnlockPubScreenList
  987.             bra.s    Skip_NoPub
  988.  
  989. ScreenFound        move.l    LN_NAME(a0),d5
  990.             CALL    UnlockPubScreenList
  991.  
  992.             move.l    d5,a0
  993.             CALL    SetDefaultPubScreen
  994.  
  995. Skip_NoPub        clr.l    d0
  996.             CALL    LockIBase
  997.             move.l    d0,d7
  998.             move.l    ib_FirstScreen(a6),d0
  999.             beq    SkipActive
  1000.             move.l    d0,a3
  1001.  
  1002. Skip_NoPub2        move.l    a3,a0
  1003.             tst.l    TempRemWin(a4)    ;Activate a Window on the new
  1004.                         ;Screen?
  1005.             beq.s    SkipActive
  1006.             bsr    GetScreenWindow
  1007.             tst.l    d0
  1008.             bne.s    FoundActive
  1009.  
  1010.             move.l    sc_FirstWindow(a0),d0    ;Take Firstwindow if none
  1011.             beq.s    SkipActive        ;known
  1012.  
  1013. FoundActive        move.l    d0,a5
  1014.             bsr    TestWindowPattern
  1015.             beq    SkipActive
  1016. NoMatter4        move.l    IntBase(a4),a6
  1017.             move.l    d7,a0
  1018.             CALL    UnlockIBase
  1019.             move.l    a5,a0
  1020.             CALL    ActivateWindow
  1021. SkipOut            RLoad    
  1022.             rts
  1023. SkipActive        move.l    IntBase(a4),a6
  1024.             move.l    d7,a0
  1025.             CALL    UnlockIBase
  1026.             bra.s    SkipOut
  1027.  
  1028.  
  1029. ;d0: Pointer to Window        ;BEQ = Use Window Not!, BMI = USE!, BNE = Empty Title
  1030. TestWindowPattern    Push    d0-d2/a0-a1/a5-a6
  1031.             move.l    d0,a5
  1032.             beq    PatternNoMatch
  1033.             tst.b    WindowPatternMem(a4)
  1034.             beq.s    NoPatternThere
  1035.             move.l    WindowPattern(a4),d1
  1036.             move.l    wd_Title(a5),d2
  1037.             beq.s    PatternNoMatchE
  1038.             move.l    DosBase(a4),a6
  1039.             CALL    MatchPatternNoCase
  1040.             beq    PatternNoMatch
  1041.  
  1042. NoPatternThere        tst.l    TempWBWin(a4)
  1043.             beq.s    PatternMatch2
  1044.             move.l    wd_Flags(a5),d0
  1045.             and.l    #WFLG_WBENCHWINDOW,d0
  1046.             bne    PatternNoMatch
  1047.  
  1048. PatternMatch2        moveq.l    #-1,d0
  1049.             bra.s    PatternMatch
  1050. PatternNoMatchE        moveq.l    #1,d0
  1051.             bra.s    PatternMatch
  1052. PatternNoMatch        clr.l    d0
  1053. PatternMatch        Pull    d0-d2/a0-a1/a5-a6
  1054.             rts
  1055.  
  1056.  
  1057.         ;a0=Screen         Back:d0=Window
  1058. GetScreenWindow        Push    a1/d1
  1059.             lea    ScreenMem(a4),a1
  1060.             move.w    #MaxScreens-1,d1
  1061. ScreenFindLoop        cmp.l    (a1),a0
  1062.             beq.s    FoundScreen
  1063.             lea    8(a1),a1
  1064.             dbf    d1,ScreenFindLoop
  1065. FoundScreen        move.l    4(a1),d0
  1066.             bsr    TestWindowOnScreen
  1067.             Pull    a1/d1
  1068.             rts
  1069.  
  1070.         ;a3=Screen a5=Window
  1071. RememberWindow        Push    a0-a3/a6/d1
  1072.             move.l    IntBase(a4),a6
  1073.             lea    ScreenMem(a4),a1
  1074.             move.w    #MaxScreens-1,d1
  1075. ScreenFindLoop2        tst.l    (a1)
  1076.             beq.s    FoundEmpty
  1077.             cmp.l    (a1),a3
  1078.             beq.s    FoundEmpty
  1079.             move.l    (a1),a2
  1080.             move.l    ib_FirstScreen(a6),d0
  1081.             beq.s    IgnoreOver    ;No FirstScreen!
  1082. CheckAllScreens        move.l    d0,a0
  1083.             cmp.l    a0,a2
  1084.             beq    ScreenValid
  1085.             move.l    sc_NextScreen(a0),d0
  1086.             bne.s    CheckAllScreens
  1087.             bra.s    FoundEmpty    ;because Entry is invalid
  1088.  
  1089. ScreenValid        lea    8(a1),a1
  1090.             dbf    d1,ScreenFindLoop2
  1091.             ;Reaching this Point our List is full of valid
  1092.             ;Screens - not the best thing, but we simply ignore...
  1093.             bra.s    IgnoreOver
  1094. FoundEmpty        move.l    a3,(a1)
  1095.             move.l    a5,4(a1)
  1096. IgnoreOver        Pull    a0-a3/a6/d1
  1097.             rts
  1098.  
  1099.         ;d0=Window , a0=Screen    =Back: d0=0 no window
  1100. TestWindowOnScreen    tst.l    d0
  1101.             beq.s    NotWindow
  1102.             move.l    sc_FirstWindow(a0),d1
  1103.             beq.s    NotWindow
  1104. WindowListOn        move.l    d1,a1
  1105.             cmp.l    d0,a1
  1106.             beq.s    WindowIsOK
  1107.             move.l    wd_NextWindow(a1),d1
  1108.             bne.s    WindowListOn
  1109. WindowIsOK        move.l    a1,d0
  1110.             rts
  1111. NotWindow        clr.l    d0
  1112.             rts
  1113.  
  1114.  
  1115. Interrupt3        Push    d1-d4/a0-a1/a3/a4/a6
  1116.             move.l    RememberA4,a4
  1117.             move.l    IntBase(a4),a3
  1118.             move.l    ib_ActiveWindow(a3),d0
  1119.             beq.s    DoScreen
  1120.             move.l    Active(a4),a0
  1121.             cmp.l    a0,d0            ;New ActiveWindow?
  1122.             beq.s    CheckSize
  1123.             move.l    Active(a4),LastActive(a4)
  1124.             move.l    d0,Active(a4)
  1125.             move.l    d0,a0
  1126. ChangedPosOrSize    move.l    wd_LeftEdge(a0),WindPosRem(a4)
  1127.             move.l    wd_Width(a0),WindSizeRem(a4)
  1128.  
  1129.             bsr    SignalMyself
  1130.  
  1131.             bset    #SignalWindow,What(a4)
  1132.             
  1133.             bra.s    DoScreen
  1134.  
  1135. CheckSize        move.l    wd_LeftEdge(a0),d0    ;A Check on .l is faster
  1136.             cmp.l    WindPosRem(a4),d0    ;because I only wanna know
  1137.             bne.s    ChangedPosOrSize    ;if Position or Size changed
  1138.             move.l    wd_Width(a0),d0        ;and not how
  1139.             cmp.l    WindSizeRem(a4),d0
  1140.             bne.s    ChangedPosOrSize
  1141.             
  1142. DoScreen        move.l    FirstSc(a4),d0
  1143.             cmp.l    ib_FirstScreen(a3),d0        ;New FirstScreen?
  1144.             beq.s    DoNothing
  1145.             move.l    ib_FirstScreen(a3),FirstSc(a4)
  1146.  
  1147.             bsr    SignalMyself
  1148.  
  1149.             bset    #SignalScreen,What(a4)
  1150.  
  1151. DoNothing        Pull    d1-d4/a0-a1/a3/a4/a6
  1152.             moveq.l    #0,d0
  1153.             rts
  1154.  
  1155. SignalMyself        move.l  $04,a6
  1156.             move.w    #1,DelayDo(a4)
  1157.             move.l  OwnTask(a4),a1
  1158.             move.l  Signal(a4),d1        ;send a signal to move Screen
  1159.             moveq.l    #0,d0
  1160.             bset    d1,d0
  1161.             jmp    _LVOSignal(a6)
  1162.  
  1163. OpenGUI            RSave
  1164.             tst.w    GUIOpened(a4)
  1165.             bne    OpenNoGUI
  1166.             move.l    IntBase(a4),a6
  1167.             sub.l    a0,a0
  1168.             CALL    LockPubScreen
  1169.             move.l    d0,PublicScreen(a4)
  1170.             move.l    d0,StorePublicScreen
  1171.  
  1172.             move.l    d0,a0
  1173.             lea    sc_RastPort(a0),a1
  1174.             move.l    a1,PublicRastport(a4)
  1175.             lea    TagListDone(pc),a1
  1176.             move.l    GadBase(a4),a6
  1177.             CALL    GetVisualInfoA
  1178.             move.l    d0,MyVisual(a4)
  1179.             lea    MyNewGadget(a4),a3
  1180.             move.l    d0,gng_VisualInfo(a3)
  1181.  
  1182.             lea    GadgetList(a4),a0
  1183.             CALL    CreateContext
  1184.             move.l    d0,Gadget0(a4)
  1185.  
  1186.             move.l    GraphicsBase(a4),a6
  1187.             move.l    PublicRastport(a4),a1
  1188.             lea    GUI_Text5(pc),a0
  1189.             moveq.l    #GUI_Text6-GUI_Text5-1,d0
  1190.             CALL    TextLength
  1191.             add.w    #40,d0        ;CheckBox
  1192.             ;lsr.w    #1,d0
  1193.             move.w    d0,RemLen(a4)
  1194.  
  1195.             moveq.l    #1,d0
  1196.             add.w    RemLen(a4),d0
  1197.             mulu    #NumberOfCols,d0
  1198.             move.l    d0,StoreInnerWidth
  1199.  
  1200.             move.l    PublicScreen(a4),a0
  1201.             moveq.l    #6,d0
  1202.             add.b    sc_WBorLeft(a0),d0
  1203.             move.w    d0,RemLeft(a4)
  1204.  
  1205.             move.l    sc_Font(a0),a1
  1206.             move.l    a1,gng_TextAttr(a3)
  1207.             moveq.l    #1,d0
  1208.             add.b    sc_WBorTop(a0),d0    ;Base (Top)
  1209.             move.w    d0,RemTop(a4)
  1210.  
  1211.             move.w    ta_YSize(a1),d6
  1212.             add.w    #4,d6            ;Height of One Line
  1213.             move.w    d6,RemHeight(a4)
  1214.  
  1215.             add.w    #2,d6
  1216.             mulu    #NumberOfLines,d6
  1217.             add.w    #8,d6
  1218.             move.l    d6,StoreInnerHeight
  1219.  
  1220.             move.l    Gadget0(a4),d7
  1221.  
  1222.             bsr    DoAllGadgets
  1223.  
  1224.             move.l    d7,LastGadget(a4)
  1225.  
  1226.             sub.l    a0,a0
  1227.             lea    WindowTagList(pc),a1
  1228.             move.l    IntBase(a4),a6
  1229.             CALL    OpenWindowTagList
  1230.             move.l    d0,MyWindow(a4)
  1231.             beq    FailWindow
  1232.  
  1233.             move.l    d0,a0
  1234.             bsr    EnterSignal
  1235.             ;move.l    d0,a0
  1236.             move.l    GadgetList(a4),a1
  1237.             moveq.l    #-1,d0
  1238.             moveq.l    #-1,d1
  1239.             sub.l    a2,a2
  1240.             CALL    AddGList
  1241.  
  1242.             move.l    GadgetList(a4),a0
  1243.             move.l    MyWindow(a4),a1
  1244.             moveq.l    #-1,d0
  1245.             sub.l    a2,a2
  1246.             CALL    RefreshGList
  1247.             
  1248.             move.l    GadBase(a4),a6
  1249.             move.l    MyWindow(a4),a0
  1250.             sub.l    a1,a1
  1251.             CALL    GT_RefreshWindow
  1252.  
  1253.             move.w    #1,GUIOpened(a4)
  1254.             RLoad
  1255.             rts
  1256. OpenNoGUI        move.l    IntBase(a4),a6
  1257.             move.l    MyWindow(a4),a0
  1258.             CALL    ActivateWindow
  1259.             RLoad
  1260.             rts
  1261.  
  1262.             rsreset
  1263. MyGadgetText        rs.l    1
  1264. MyGadgetList        rs.l    1
  1265. MyGadgetRowNr        rs.b    1
  1266. MyGadgetXPos        rs.b    1
  1267. MyGadgetWidth        rs.b    1
  1268. MyGadgetFlags        rs.b    1
  1269. MyGadgetStore        rs.w    1
  1270. MyGadgetKind        rs.w    1
  1271. MyGadgetSize        rs.w    1
  1272.             
  1273.             ;    gng_Flags      ,gng_Text ,CreateKind   ,CreateTags
  1274.             ;    gng_TopEdge    ,gng_LeftEdge
  1275. AllGadgets        dc.l    GUI_Text8,CycleTagList
  1276.             dc.b    1,1,1,PLACETEXT_LEFT
  1277.             dc.w    TempHADJ,CYCLE_KIND
  1278.  
  1279.             dc.l    GUI_Text9,CycleTagList2
  1280.             dc.b    2,1,1,PLACETEXT_LEFT
  1281.             dc.w    TempVADJ,CYCLE_KIND
  1282.  
  1283.             dc.l    GUI_Text12,StringTagList
  1284.             dc.b    3,1,1,PLACETEXT_LEFT
  1285.             dc.w    TempScreen,STRING_KIND
  1286.  
  1287.             dc.l    GUI_Text13,StringTagList
  1288.             dc.b    4,1,1,PLACETEXT_LEFT
  1289.             dc.w    TempWindow,STRING_KIND
  1290.  
  1291.             dc.l    0,SlideTagList
  1292.             dc.b    5,1,1,0
  1293.             dc.w    TempDelay,SLIDER_KIND
  1294.  
  1295.             dc.l    GUI_Text18,CycleTagList3
  1296.             dc.b    6,1,1,PLACETEXT_LEFT
  1297.             dc.w    TempAction,CYCLE_KIND
  1298.  
  1299.             dc.l    GUI_Text17,StringTagList
  1300.             dc.b    7,1,1,PLACETEXT_LEFT
  1301.             dc.w    TempActionKey,STRING_KIND
  1302.  
  1303.             dc.l    GUI_Text16,StringTagList
  1304.             dc.b    8,1,1,PLACETEXT_LEFT
  1305.             dc.w    TempCXPOPKEY,STRING_KIND
  1306.  
  1307.             dc.l    GUI_Text19,StringTagList
  1308.             dc.b    9,1,1,PLACETEXT_LEFT
  1309.             dc.w    TempLWindow,STRING_KIND
  1310.  
  1311.             dc.l    GUI_Text19_2,StringTagList
  1312.             dc.b    10,1,1,PLACETEXT_LEFT
  1313.             dc.w    TempNWindow,STRING_KIND
  1314.  
  1315.             dc.l    GUI_Text1,GadgetTagList
  1316.             dc.b    1,2,1,PLACETEXT_RIGHT
  1317.             dc.w    TempMove,CHECKBOX_KIND
  1318.  
  1319.             dc.l    GUI_Text3,GadgetTagList
  1320.             dc.b    2,2,1,PLACETEXT_RIGHT
  1321.             dc.w    TempWFront,CHECKBOX_KIND
  1322.  
  1323.             dc.l    GUI_Text6,GadgetTagList
  1324.             dc.b    3,2,1,PLACETEXT_RIGHT
  1325.             dc.w    TempRestrict,CHECKBOX_KIND
  1326.  
  1327.             dc.l    GUI_Text20,GadgetTagList
  1328.             dc.b    4,2,1,PLACETEXT_RIGHT
  1329.             dc.w    TempWBWin,CHECKBOX_KIND
  1330.  
  1331.             dc.l    GUI_Text2,GadgetTagList
  1332.             dc.b    5,2,1,PLACETEXT_RIGHT
  1333.             dc.w    TempSFront,CHECKBOX_KIND
  1334.  
  1335.             dc.l    GUI_Text5,GadgetTagList
  1336.             dc.b    6,2,1,PLACETEXT_RIGHT
  1337.             dc.w    TempPDef,CHECKBOX_KIND
  1338.  
  1339.             dc.l    GUI_Text7,GadgetTagList
  1340.             dc.b    7,2,1,PLACETEXT_RIGHT
  1341.             dc.w    TempRemWin,CHECKBOX_KIND
  1342.  
  1343.             dc.l    GUI_Text7_1,GadgetTagList
  1344.             dc.b    8,2,1,PLACETEXT_RIGHT
  1345.             dc.w    TempMoveMouse,CHECKBOX_KIND
  1346.  
  1347.             dc.l    GUI_Text7_2,GadgetTagList
  1348.             dc.b    9,2,1,PLACETEXT_RIGHT
  1349.             dc.w    TempCXPOPUP,CHECKBOX_KIND
  1350.  
  1351.  
  1352.             dc.l    GUI_Text10,TagList
  1353.             dc.b    11,0,1,PLACETEXT_IN
  1354.             dc.w    TempZero,BUTTON_KIND
  1355.             dc.l    GUI_Text11,TagList
  1356.             dc.b    11,2,1,PLACETEXT_IN
  1357.             dc.w    TempZero,BUTTON_KIND
  1358. SaveGadgData        dc.l    GUI_Text14,TagList
  1359.             dc.b    11,1,1,PLACETEXT_IN
  1360.             dc.w    TempSave,BUTTON_KIND
  1361.  
  1362.             dc.l    -1
  1363.  
  1364. NumberOfLines        =    11
  1365. NumberOfCols        =    3
  1366.  
  1367.  
  1368. ;a3:Pointer to the GadgetStructure
  1369. ;d7:Previous Gadget
  1370.  
  1371. DoAllGadgets        lea    AllGadgets(pc),a5
  1372.             move.l    GadBase(a4),a6
  1373.             moveq.l    #1,d6
  1374.  
  1375. DoAllGadgets2        tst.l    (a5)
  1376.             bmi.s    WasLastGadget
  1377.  
  1378.             moveq.l    #0,d0
  1379.             move.b    MyGadgetRowNr(a5),d0
  1380.             move.w    RemHeight(a4),d1
  1381.             addq.w    #2,d1
  1382.             mulu    d1,d0
  1383.             add.w    RemTop(a4),d0        ;Top
  1384.             move.w    d0,gng_TopEdge(a3)
  1385.  
  1386.             moveq.l    #0,d0
  1387.             move.b    MyGadgetXPos(a5),d0
  1388.             mulu    RemLen(a4),d0
  1389.             add.w    RemLeft(a4),d0
  1390.             move.w    d0,gng_LeftEdge(a3)
  1391.  
  1392.             moveq.l    #0,d0
  1393.             move.b    MyGadgetWidth(a5),d0
  1394.             mulu    RemLen(a4),d0
  1395.             sub.w    #8,d0
  1396.             move.w    d0,gng_Width(a3)
  1397.  
  1398.             move.w    RemHeight(a4),gng_Height(a3)
  1399.  
  1400.             moveq.l    #0,d0
  1401.             move.b    MyGadgetFlags(a5),d0
  1402.             move.l    d0,gng_Flags(a3)
  1403.             add.w    #1,gng_GadgetID(a3)
  1404.  
  1405.             move.l    MyGadgetText(a5),gng_GadgetText(a3)
  1406.  
  1407.             move.w    d6,gng_GadgetID(a3)
  1408.  
  1409.             sub.l    a2,a2
  1410.             move.w    MyGadgetStore(a5),a2
  1411.             add.l    a4,a2
  1412.             move.l    (a2),d4
  1413.  
  1414.             moveq.l    #0,d0
  1415.             move.w    MyGadgetKind(a5),d0
  1416.             move.l    d7,a0        ;Previous Gadget
  1417.             move.l    a3,a1
  1418.             move.l    MyGadgetList(a5),a2
  1419.             move.l    d4,4(a2)
  1420.             CALL    CreateGadgetA
  1421.             move.l    d0,d7        ;Remember Previous Gadget
  1422.             add.l    #MyGadgetSize,a5
  1423.             addq.l    #1,d6
  1424.             bra.s    DoAllGadgets2
  1425. WasLastGadget        rts
  1426.  
  1427. CheckGUI        RSave
  1428.  
  1429.             tst.w    GUIOpened(a4)
  1430.             beq    NoGUI
  1431.  
  1432.             move.l    GadBase(a4),a6
  1433.             move.l    MyWindow(a4),a0
  1434.             move.l  wd_UserPort(a0),a0
  1435.             CALL    GT_GetIMsg
  1436.             tst.l   d0         
  1437.             beq     NoGUI
  1438.             move.l  d0,a1
  1439.             moveq.l    #0,d6
  1440.             move.w    im_Code(a1),d6    ;Value of Gadget
  1441.             move.l  im_IAddress(a1),a2
  1442.  
  1443.             move.l    im_Class(a1),d7
  1444.             CALL    GT_ReplyIMsg
  1445.  
  1446.             cmp.l    #GADGETUP,d7
  1447.             bne    Others
  1448.  
  1449.             move.w    gg_GadgetID(a2),d0
  1450.             move.l    gg_SpecialInfo(a2),a3
  1451.             cmp.w    #20,d0
  1452.             beq    HideGad
  1453.             cmp.w    #21,d0
  1454.             beq    QuitGad
  1455.             cmp.w    #22,d0
  1456.             beq    SaveGad
  1457.  
  1458.             subq.l    #1,d0
  1459.  
  1460.             lea    AllGadgets(pc),a5
  1461.             mulu    #MyGadgetSize,d0
  1462.             sub.l    a2,a2
  1463.             move.w    MyGadgetStore(a5,d0.w),a2
  1464.             add.l    a4,a2
  1465.  
  1466. StringTest        cmp.w    #STRING_KIND,MyGadgetKind(a5,d0.w)
  1467.             bne.s    CheckBoxTest
  1468.             move.l    si_Buffer(a3),a0
  1469.             move.l    (a2),a1
  1470.             bsr    CopyPattern
  1471.             bsr    BuildPatterns
  1472.             bsr    InstallHotKey
  1473.             bra.s    NoGUI
  1474.  
  1475. CheckBoxTest        cmp.w    #CHECKBOX_KIND,MyGadgetKind(a5,d0.w)
  1476.             bne.s    StandardGUI
  1477.             ;using im_Code works only since V39, so:
  1478.             moveq.l    #1,d6
  1479.             tst.l    (a2)
  1480.             beq.s    StandardGUI
  1481.             moveq.l    #0,d6
  1482.  
  1483. StandardGUI        move.l    d6,(a2)
  1484.             bra.s    NoGUI
  1485.  
  1486. SaveGad            bsr    SaveConfig
  1487.             bra.s    NoGUI
  1488.  
  1489. QuitGad            bsr    CloseGUI
  1490.             move.w    #1,QuitMe(a4)
  1491.             bra.s    HideGad
  1492.  
  1493. Others                    cmp.l   #CLOSEWINDOW,d7
  1494.                     bne.s    NoClose
  1495. HideGad            bsr    CloseGUI
  1496.             bra.s    NoGUI
  1497. NoClose            cmp.l    #IDCMP_VANILLAKEY,d7
  1498.             bne.s    NoGUI
  1499.             cmp.b    #"q",d6
  1500.             beq.s    QuitGad
  1501.             cmp.b    #"s",d6
  1502.             beq.s    SaveGad
  1503.             cmp.b    #"h",d6
  1504.             beq.s    HideGad
  1505.  
  1506. NoGUI            RLoad
  1507.             rts
  1508.  
  1509. CloseGUI        RSave
  1510.             tst.w    GUIOpened(a4)
  1511.             beq.s    NotOpened
  1512.  
  1513.             bsr    RefreshStrings
  1514.  
  1515.             move.l    IntBase(a4),a6
  1516.             move.l    MyWindow(a4),a0
  1517.             bsr    RemoveSignal
  1518.             ;move.l    MyWindow(a4),a0
  1519.             move.l    GadgetList(a4),a1
  1520.             moveq.l    #-1,d0
  1521.             CALL    RemoveGList
  1522.  
  1523.             move.l    MyWindow(a4),a0
  1524.             clr.l    d0
  1525.             move.w    wd_TopEdge(a0),d0
  1526.             move.l    d0,RemWindowY
  1527.             move.w    wd_LeftEdge(a0),d0
  1528.             move.l    d0,RemWindowX
  1529.             CALL    CloseWindow
  1530.             
  1531. FailWindow        move.l    GadgetList(a4),a0
  1532.             move.l    GadBase(a4),a6
  1533.             CALL    FreeGadgets
  1534.  
  1535.             move.l    MyVisual(a4),a0
  1536.             CALL    FreeVisualInfo
  1537.  
  1538.             move.l    IntBase(a4),a6
  1539.             sub.l    a0,a0
  1540.             move.l    PublicScreen(a4),a1
  1541.             CALL    UnlockPubScreen
  1542.  
  1543. NotOpened        clr.w    GUIOpened(a4)
  1544.  
  1545.             RLoad
  1546.             rts
  1547.  
  1548. EnterSignal        Push    d0-d1/a0          
  1549.             move.l  wd_UserPort(a0),a0
  1550.             move.b  MP_SIGBIT(a0),d0  
  1551.             move.l    SignalMask(a4),d1
  1552.             bset    d0,d1             
  1553.             move.l  d1,SignalMask(a4) 
  1554.             Pull    d0-d1/a0          
  1555.             rts                       
  1556.                                           
  1557. RemoveSignal        Push    d0-d1/a0          
  1558.             move.l  wd_UserPort(a0),a0
  1559.             move.b  MP_SIGBIT(a0),d0
  1560.             move.l    SignalMask(a4),d1
  1561.             bclr    d0,d1             
  1562.             move.l    d1,SignalMask(a4) 
  1563.             Pull    d0-d1/a0          
  1564.             rts
  1565.  
  1566. GetNexta0.1        tst.b    (a0)+
  1567. GetNexta0        move.b    (a0),d0
  1568.             cmp.b    #"=",d0
  1569.             beq.s    GetNexta0.1
  1570.             cmp.b    #" ",d0
  1571.             beq.s    GetNexta0.1
  1572.             or.w    #$20,d0
  1573.             rts
  1574.  
  1575. RefreshStrings        RSave
  1576.             move.l    GadgetList(a4),a3
  1577.  
  1578. ThruAll            move.w    gg_GadgetID(a3),d0
  1579.             subq.l    #1,d0
  1580.             lea    AllGadgets(pc),a5
  1581.             mulu    #MyGadgetSize,d0
  1582.             sub.l    a2,a2
  1583.             move.w    MyGadgetStore(a5,d0.w),a2
  1584.             add.l    a4,a2    ;TempXXX
  1585.  
  1586.             cmp.w    #STRING_KIND,MyGadgetKind(a5,d0.w)
  1587.             bne.s    NextGaddie
  1588.             move.l    gg_SpecialInfo(a3),a0
  1589.             move.l    si_Buffer(a0),a0
  1590.             move.l    (a2),a1
  1591.             bsr    CopyPattern
  1592.             bsr    BuildPatterns
  1593.             bsr    InstallHotKey
  1594.  
  1595. NextGaddie        move.l    gg_NextGadget(a3),a3
  1596.             move.l    a3,d0
  1597.             bne.s    ThruAll
  1598.             RLoad
  1599.             rts
  1600.  
  1601.  
  1602. ;Screen in a0, X-Coord(rel) in d0, Y-Coord(rel) in d1
  1603. SetPointer        Push    a0-a2/d0-d1/a6
  1604.             lea    PointerPixEvent(a4),a2
  1605.             move.l    a0,iepp_Screen(a2)
  1606.             move.w    sc_MouseX(a0),d2
  1607.             move.w    sc_MouseY(a0),d3
  1608.  
  1609.             move.l    MyIORequest(a4),a1
  1610.             move.w    #IND_WRITEEVENT,io_Command(a1)
  1611.             lea    MyInputEvent(a4),a0
  1612.             move.l    #0,ie_NextEvent(a0)
  1613.             move.b    #IECLASS_NEWPOINTERPOS,ie_Class(a0)
  1614.             move.w    #0,ie_Qualifier(a0)
  1615.             add.w    d0,d2
  1616.             add.w    d1,d3
  1617.             move.w    d2,iepp_PositionX(a2)
  1618.             move.w    d3,iepp_PositionY(a2)
  1619.             move.l    a2,ie_EventAddress(a0)
  1620.  
  1621.             move.b    #IESUBCLASS_PIXEL,ie_SubClass(a0)
  1622.             move.w    #IECODE_NOBUTTON,ie_Code(a0)
  1623.             move.l    a0,io_Data(a1)
  1624.             move.l    #ie_SIZEOF,io_Length(a1)
  1625.             move.l    $04,a6
  1626.             CALL    DoIO
  1627.             Pull    a0-a2/a6/d0-d1
  1628.             rts
  1629.  
  1630. BuildPatterns        RSave
  1631.             tst.l    TempScreen(a4)
  1632.             beq.s    NoScreenPattern
  1633.             move.l    TempScreen(a4),a0
  1634.             bsr    GetNexta0
  1635.             lea    ScreenPatternMem(a4),a1
  1636.             bsr    CopyPattern
  1637.  
  1638.             lea    ScreenPatternMem(a4),a0
  1639.             lea    ScreenPatLen(a4),a2
  1640.             lea    ScreenPattern(a4),a3
  1641.             bsr    GetLen
  1642.             bpl    NoScreenPattern
  1643.             bsr    PatternError
  1644.  
  1645. NoScreenPattern        lea    ScreenPatternMem(a4),a0
  1646.             move.l    a0,TempScreen(a4)
  1647.             tst.l    TempWindow(a4)
  1648.             beq.s    NoWindowPattern
  1649.             move.l    TempWindow(a4),a0
  1650.             bsr    GetNexta0
  1651.             lea    WindowPatternMem(a4),a1
  1652.             bsr    CopyPattern
  1653.  
  1654.             lea    WindowPatternMem(a4),a0
  1655.             lea    WindowPatLen(a4),a2
  1656.             lea    WindowPattern(a4),a3
  1657.             bsr    GetLen
  1658.             bpl.s    NoWindowPattern
  1659.             bsr    PatternError
  1660.     
  1661. NoWindowPattern        lea    WindowPatternMem(a4),a0
  1662.             move.l    a0,TempWindow(a4)
  1663.             RLoad
  1664.             rts        
  1665.  
  1666. PatternError        lea    Text3(pc),a0
  1667.             bra    OpenRequester
  1668.  
  1669. ;a0:Source, a1:Dest
  1670. CopyPattern        move.w    #511,d0
  1671. CopyPattern2        move.b    (a0)+,(a1)+
  1672.             beq.s    EndCopy
  1673.             dbf    d0,CopyPattern2
  1674.             bsr    PatternError
  1675. EndCopy            rts
  1676.  
  1677.  
  1678. ;In: (a2): LEN - (a3): MEMORY - a0: Source-Pattern    :back: d0=pattern ok?
  1679. GetLen            move.l    a0,d6
  1680.             clr.l    d3
  1681. GetLen2            tst.b    (a0)+
  1682.             beq.s    EndOfString
  1683.             addq.l    #1,d3
  1684.             bra.s    GetLen2
  1685. EndOfString        lsl.w    #1,d3    ;StandardLen Of Pattern
  1686.             addq    #2,d3
  1687.             move.l    $04,a6
  1688.             tst.l    (a3)
  1689.             beq    AllocNew
  1690.             move.l    (a3),a1
  1691.             move.l    (a2),d0
  1692.             CALL    FreeMem
  1693.             clr.l    (a3)
  1694. AllocNew        move.l    d3,(a2)
  1695.             move.l    d3,d0
  1696.             move.l    #MEMF_CLEAR,d1
  1697.             CALL    AllocMem
  1698.             move.l    d0,d2
  1699.             beq    QuitPrg        ;No Memory? Good bye !
  1700.             move.l    d0,(a3)
  1701.             move.l    d6,d1
  1702.             move.l    DosBase(a4),a6
  1703.             CALL    ParsePatternNoCase
  1704.             rts
  1705.  
  1706.             
  1707. ;a0: Requester-Text
  1708. OpenRequester        Push    a0-a3
  1709.             lea    EasyReqStruct(a4),a1
  1710.             lea    PortName(pc),a2
  1711.             move.l    a2,es_Title(a1)
  1712.             move.l    a0,es_TextFormat(a1)
  1713.             lea    GadgetText(pc),a2
  1714.             move.l    a2,es_GadgetFormat(a1)
  1715.             move.l    IntBase(a4),a6
  1716.             sub.l    a0,a0
  1717.             ;a1: EasyReq
  1718.             sub.l    a2,a2
  1719.             sub.l    a3,a3
  1720.             CALL    EasyRequestArgs
  1721.             Pull    a0-a3
  1722.             rts
  1723.  
  1724. SaveConfig        RSave
  1725.             tst.l    WBMessage(a4)
  1726.             beq    SkipConfig
  1727.             move.l    WBMessage(a4),a3
  1728.             move.l    sm_ArgList(a3),d0
  1729.             beq    SkipConfig
  1730.             move.l    d0,a0
  1731.             move.l    wa_Name(a0),a0
  1732.             move.l    a0,d5
  1733.  
  1734.             move.l    DObject(a4),d0
  1735.             beq    SkipConfig
  1736.  
  1737.             move.l    d0,a0
  1738.             move.l    do_ToolTypes(a0),a5    ;Remember Old
  1739.             move.l    #1,TempDummy(a4)
  1740.  
  1741.             bsr    RefreshStrings
  1742.  
  1743.             Push    a0/a6
  1744.             move.l    $04,a6
  1745.             move.l    #NumberOfTemps*10+2*512+2*8,d0    ;Memory for tool arrays
  1746.             move.l    #MEMF_CLEAR,d1
  1747.             CALL    AllocMem
  1748.             move.l    d0,a3
  1749.             beq    MemErrTool
  1750.             move.l    DObject(a4),a0
  1751.             move.l    d0,do_ToolTypes(a0)
  1752.  
  1753.             move.l    d0,a1
  1754.             add.l    #(NumberOfTemps+1)*4,a1    ;Maximum Number of Pointers
  1755.  
  1756.             clr.l    d7
  1757.             lea    WBTemplate(pc),a2
  1758. LoopAllTemps        sub.l    a0,a0
  1759.             move.w    TemplateA4(a2),a0
  1760.             add.l    a4,a0
  1761.             move.l    (a0),d6
  1762.             beq.s    IsDefault
  1763.             move.l    a1,(a3,d7)
  1764.             move.l    TemplateText(a2),a0
  1765.             bsr    CopyPattern
  1766.             move.w    TemplateType(a2),d1
  1767.             beq    ThatsAllTemp
  1768.             move.b    #"=",-1(a1)
  1769.             
  1770.             cmp.w    #T_CYCLE,d1
  1771.             bne.s    ThatsString
  1772.             move.l    TemplateSpecial(a2),a0
  1773.             lsl.l    #2,d6
  1774.             move.l    (a0,d6.w),a0
  1775.             bsr    CopyPattern
  1776.             bra.s    ThatsAllTemp
  1777.  
  1778. ThatsString        cmp.w    #T_STRING,d1
  1779.             bne.s    ThatsInteger
  1780.             move.l    d6,a0
  1781.             bsr    CopyPattern
  1782.             bra.s    ThatsAllTemp
  1783.  
  1784. ThatsInteger        move.l    d6,d0
  1785.             bsr    PrintInteger
  1786.  
  1787. ThatsAllTemp        addq.l    #4,d7
  1788.             move.l    a1,d0
  1789.             and.l    #$ffffffc,d0
  1790.             move.l    d0,a1
  1791.             lea    4(a1),a1    ;Align on Longwords
  1792. IsDefault        add.l    #TemplateSize,a2
  1793.             tst.l    TemplateText(a2)
  1794.             bne    LoopAllTemps
  1795.  
  1796.             move.l    d5,a0
  1797.             move.l    DObject(a4),a1
  1798.             move.l    IconBase(a4),a6
  1799.             CALL    PutDiskObject
  1800.             bne.s    Done
  1801.             lea    Text4(pc),a0
  1802.             bsr    OpenRequester
  1803.  
  1804. Done            move.l    $04,a6
  1805.             move.l    #NumberOfTemps*10+2*512+2*8,d0
  1806.             move.l    a3,a1
  1807.             CALL    FreeMem
  1808. MemErrTool        Pull    a0/a6
  1809.  
  1810.             move.l    a5,do_ToolTypes(a0)
  1811.                 
  1812.             bra.s    DoneConfig
  1813.  
  1814. SkipConfig        lea    Text4(pc),a0
  1815.             bsr    OpenRequester
  1816. DoneConfig        RLoad
  1817.             rts
  1818.  
  1819.  
  1820. ;Where in hell has this damned OS a atoi and itoa function???
  1821.  
  1822. ;Quick implementation of word-only functions:
  1823.  
  1824. ;a0:String    Back: d0: Integer
  1825. GetInteger        Push    d1-d2/a0
  1826.             moveq.l    #0,d0
  1827.             moveq.l    #0,d1
  1828.             moveq.l    #1,d2
  1829.             cmp.b    #"-",(a0)
  1830.             bne.s    GetDezNr
  1831.             tst.b    (a0)+
  1832.             moveq.l    #-1,d2
  1833. GetDezNr        move.b    (a0)+,d1
  1834.             cmp.b    #"0",d1
  1835.             bcs    StringOver
  1836.             cmp.b    #"9"+1,d1
  1837.             bcc    StringOver
  1838.             sub.w    #$30,d1
  1839.             mulu    #$0a,d0
  1840.             add.l    d1,d0
  1841.             bra.s    GetDezNr
  1842. StringOver        muls    d2,d0
  1843.             Pull    d1-d2/a0
  1844.             rts    
  1845.  
  1846. ;d0: Integer        a1:String
  1847. PrintInteger        tst.l    d0
  1848.             bpl.s    PrDez0
  1849.             move.b    #"-",(a1)+
  1850.             neg.l    d0
  1851. PrDez0            move.w    #-1,-(sp)
  1852. PrDez            divu    #$0a,d0
  1853.             swap    d0
  1854.             move.w    d0,-(sp)
  1855.             clr.w    d0
  1856.             swap    d0
  1857.             bne.s    PrDez
  1858. PrDez1            move.w    (sp)+,d0
  1859.             bmi.s    CloseUp
  1860.             add.w    #"0",d0
  1861.             move.b    d0,(a1)+
  1862.             bra.s    PrDez1
  1863. CloseUp            clr.b    (a1)+
  1864.             rts
  1865.  
  1866.             rsreset
  1867. HK_Default        rs.l    1
  1868. HK_Description        rs.l    1
  1869. HK_Store        rs.l    1
  1870. HK_ID            rs.l    1
  1871. HK_Filter        rs.l    1
  1872. HK_SIZEOF        rs.l    0
  1873.  
  1874. HotKeyTable        dc.l    DefaultDescr4,Description4,TempNWindow,MyNWinID,Filter4
  1875.             dc.l    DefaultDescr3,Description3,TempLWindow,MyLWinID,Filter3
  1876.             dc.l    DefaultDescr2,Description2,TempActionKey,MyActionID,Filter2
  1877.             dc.l    DefaultDescr,Description,TempCXPOPKEY,MyHotkeyID,Filter
  1878.             dc.l    0
  1879.  
  1880. InstallHotKey        Push    a0-a1/a5-a6/d4-d5
  1881.             lea    HotKeyTable(pc),a5
  1882. InstallHotKey2        move.l    HK_Default(a5),a0
  1883.             move.l    HK_Description(a5),d0
  1884.             lea    (a4,d0),a1
  1885.             move.l    HK_Store(a5),d4
  1886.             tst.l    (a4,d4)
  1887.             beq.s    NoPOPKEY
  1888.             move.l    (a4,d4),a0
  1889.             bsr    GetNexta0
  1890. NoPOPKEY        move.l    a1,(a4,d4)
  1891.             bsr    CopyKey
  1892.             bmi.s    HotKeyError
  1893.  
  1894.             move.l    HK_Filter(a5),d5
  1895.             bsr    RemovePopKey
  1896.  
  1897.             move.l    HK_Description(a5),d0
  1898.             lea    (a4,d0),a0
  1899.             move.l    MyPort(a4),a1
  1900.             move.l    HK_ID(a5),d0
  1901.             bsr    HotKey
  1902.             bmi.s    HotKeyError
  1903.             move.l    a0,(a4,d5)
  1904.             CALL    CxObjError
  1905.             tst.l    d0
  1906.             bne.s    DeleteAndErr
  1907.             move.l    (a4,d5),a1
  1908.             move.l    Broker(a4),a0
  1909.             CALL    AttachCxObj
  1910.  
  1911.             lea    HK_SIZEOF(a5),a5
  1912.             tst.l    (a5)
  1913.             bne.s    InstallHotKey2
  1914.             Pull    a0-a1/a5-a6/d4-d5
  1915.             rts
  1916.  
  1917. DeleteAndErr        bsr    DeletePopKey
  1918. HotKeyError        lea    HotKeyErrorT(pc),a0
  1919.             bsr    OpenRequester
  1920.             clr.l    (a4,d4)
  1921.             bra    InstallHotKey2
  1922.  
  1923. CopyKey            move.w    #63,d0
  1924. CopyString        move.b    (a0)+,(a1)+
  1925.             beq.s    EndString
  1926.             dbf    d0,CopyString
  1927.             moveq.l    #-1,d0
  1928. EndString        rts
  1929.  
  1930. RemovePopKey        move.l    CommBase(a4),a6
  1931.             tst.l    (a4,d5)
  1932.             beq.s    NoFilter
  1933.             move.l    (a4,d5),a0
  1934.             CALL    RemoveCxObj
  1935. DeletePopKey        move.l    (a4,d5),a0
  1936.             CALL    DeleteCxObjAll
  1937.             clr.l    (a4,d5)
  1938. NoFilter        rts                
  1939.  
  1940.  
  1941. ;Implementation of the cx.lib function
  1942. ;HotKey(char *Description,MsgPort *CxPort,long Event)
  1943.  
  1944. ;a0=Description, a1=CxPort, d0=Event    ;Back: d0:Error, a0:Filter
  1945. HotKey            Push    d1-d7/a1-a2/a6
  1946.             move.l    a1,a2        ;Rem Port
  1947.             move.l    d0,d6        ;Rem Event
  1948.             move.l    CommBase(a4),a6
  1949.             move.l    #CX_FILTER,d0
  1950.             ;Description is in a0
  1951.             sub.l    a1,a1
  1952.             CALL    CreateCxObj
  1953.             move.l    d0,d7        ;Remember Filter
  1954.             beq.s    HKErr2
  1955.             move.l    #CX_SEND,d0
  1956.             move.l    a2,a0        ;Given Port
  1957.             move.l    d6,a1        ;Event
  1958.             CALL    CreateCxObj
  1959.             move.l    d0,d6        ;Remember Sender
  1960.             beq.s    HKErr
  1961.             move.l    d7,a0        ;Filter
  1962.             move.l    d6,a1        ;Sender
  1963.             CALL    AttachCxObj
  1964.             move.l    #CX_TRANSLATE,d0
  1965.             sub.l    a0,a0
  1966.             move.l    a0,a1
  1967.             CALL    CreateCxObj
  1968.             move.l    d0,a1
  1969.             tst.l    d0
  1970.             beq.s    HKErr
  1971.             move.l    d7,a0            ;Filter 
  1972.             ;Translate is in a1
  1973.             CALL    AttachCxObj
  1974.             move.l    d7,a0        ;Return Filter in a0
  1975.             moveq.l    #0,d0
  1976.             bra.s    HKOut
  1977. HKErr            move.l    d7,a0
  1978.             CALL    DeleteCxObjAll
  1979. HKErr2            moveq.l    #-1,d0
  1980. HKOut            Pull    d1-d7/a1-a2/a6
  1981.             rts
  1982.  
  1983. TestButton        RSave
  1984.             cmp.l    #0,a0
  1985.             beq.s    SkipTestButton
  1986.             move.l    RememberA4,a4
  1987.             move.l    CommBase(a4),a6
  1988.             CALL    CxMsgData
  1989.             tst.l    d0
  1990.             beq    SkipTestButton
  1991.             move.l    d0,a0
  1992.             cmp.b    #IECLASS_RAWMOUSE,ie_Class(a0)
  1993.             bne.s    SkipTestButton
  1994.             cmp.w    #IECODE_UP_PREFIX!IECODE_LBUTTON,ie_Code(a0)
  1995.             beq.s    RelButton
  1996.             cmp.w    #IECODE_LBUTTON,ie_Code(a0)
  1997.             bne.s    SkipTestButton
  1998.             move.w    #1,ButtonPressed(a4)
  1999.             bra.s    SkipTestButton
  2000. RelButton        clr.w    ButtonPressed(a4)
  2001.             bsr    SignalMyself
  2002.  
  2003.             bset    #SignalButton,What(a4)
  2004.  
  2005. SkipTestButton        RLoad
  2006.             rts
  2007.  
  2008.             IFNE    DEBUG
  2009. BLINK            RSave
  2010.             move.w    #$10,d1
  2011. blink2            move.w    #$7fff,d0
  2012. blink1            move.w    d0,$dff180
  2013.             dbf    d0,blink1
  2014.             dbf    d1,blink2
  2015.             RLoad
  2016.             rts
  2017.             ENDC
  2018.  
  2019. StringTagList        dc.l    GTST_String
  2020.             dc.l    0
  2021.             dc.l    GTST_MaxChars
  2022.             dc.l    511
  2023.             dc.l    TAG_DONE
  2024.  
  2025. CycleTagList        dc.l    GTCY_Active
  2026.             dc.l    0
  2027.             dc.l    GTCY_Labels
  2028.             dc.l    CycleList
  2029.             dc.l    TAG_DONE
  2030.  
  2031. CycleTagList2        dc.l    GTCY_Active
  2032.             dc.l    0
  2033.             dc.l    GTCY_Labels
  2034.             dc.l    CycleList2
  2035.             dc.l    TAG_DONE
  2036.  
  2037. CycleTagList3        dc.l    GTCY_Active
  2038.             dc.l    0
  2039.             dc.l    GTCY_Labels
  2040.             dc.l    CycleList3
  2041.             dc.l    TAG_DONE
  2042.  
  2043. GadgetTagList        dc.l    GTCB_Checked
  2044.             dc.l    0
  2045.             dc.l    TAG_DONE
  2046.  
  2047. SlideTagList        dc.l    GTSL_Level
  2048.             dc.l    0
  2049.             dc.l    GTSL_Min
  2050.             dc.l    0
  2051.             dc.l    GTSL_Max
  2052.             dc.l    99
  2053.             dc.l    GTSL_LevelFormat
  2054.             dc.l    SliderText
  2055.             dc.l    GTSL_LevelPlace
  2056.             dc.l    PLACETEXT_LEFT
  2057.             dc.l    GTSL_MaxLevelLen
  2058.             dc.l    50
  2059.             dc.l    GA_RelVerify
  2060.             dc.l    1
  2061.             dc.l    TAG_DONE
  2062.  
  2063. TagList            dc.l    GA_Disabled
  2064.             dc.l    0
  2065.             dc.l    GT_Underscore
  2066.             dc.l    '_'
  2067. TagListDone        dc.l    TAG_DONE
  2068.  
  2069. WindowTagList        dc.l    WA_InnerWidth
  2070. StoreInnerWidth            dc.l    0
  2071.             dc.l    WA_InnerHeight
  2072. StoreInnerHeight        dc.l    0
  2073.             dc.l    WA_IDCMP
  2074.                 dc.l    BUTTONIDCMP!CLOSEWINDOW!IDCMP_VANILLAKEY
  2075.             dc.l    WA_Flags
  2076.                 dc.l    WINDOWCLOSE!WINDOWDRAG!WINDOWDEPTH!ACTIVATE    
  2077.             dc.l    WA_PubScreen
  2078. StorePublicScreen        dc.l    0
  2079.             dc.l    WA_Title
  2080.                 dc.l    Texth
  2081.             dc.l    WA_AutoAdjust
  2082.                 dc.l    1
  2083.             dc.l    WA_Left
  2084. RemWindowX            dc.l    -1
  2085.             dc.l    WA_Top
  2086. RemWindowY            dc.l    -1
  2087.             dc.l    TAG_DONE
  2088.  
  2089. RememberA4        dc.l    0
  2090. RememberStack        dc.l    0
  2091.  
  2092.             rsreset
  2093. ScreenPatLen        rs.l    1
  2094. ScreenPattern        rs.l    1
  2095. WindowPatLen        rs.l    1
  2096. WindowPattern        rs.l    1
  2097. GadgetList        rs.l    1
  2098. WindPosRem        rs.l    1
  2099. WindSizeRem        rs.l    1
  2100. PositionX        rs.w    1
  2101. PositionY        rs.w    1
  2102. What            rs.w    1
  2103. DisableHW        rs.w    1
  2104. GUIOpened        rs.w    1
  2105. QuitMe            rs.w    1
  2106. RemFontSize        rs.w    1
  2107. ButtonPressed        rs.w    1
  2108. GadgetInside        rs.w    11
  2109. MyPort            rs.l    1
  2110. MyVisual        rs.l    1
  2111. Broker            rs.l    1
  2112. LastActive        rs.l    1
  2113. ScreenMem        rs.b    ScreenMemSize
  2114. IntBase            rs.l    1
  2115. IBaseLock        rs.l    1
  2116. RemLen            rs.w    1
  2117. RemHeight        rs.w    1
  2118. RemTop            rs.w    1
  2119. RemLeft            rs.w    1
  2120. DelayDo            rs.w    1
  2121. GadBase            rs.l    1
  2122. DosBase            rs.l    1
  2123. CommBase        rs.l    1
  2124. IconBase        rs.l    1
  2125. DObject            rs.l    1
  2126. Active            rs.l    1
  2127. FirstSc            rs.l    1
  2128. GraphicsBase        rs.l    1
  2129. PublicScreen        rs.l    1
  2130. PublicRastport        rs.l    1
  2131. Gadget0            rs.l    1
  2132. Filter            rs.l    1
  2133. Filter2            rs.l    1
  2134. Filter3            rs.l    1
  2135. Filter4            rs.l    1
  2136. Filter5            rs.l    1
  2137. VisualX            rs.w    1
  2138. VisualY            rs.w    1
  2139. TemplateArray        rs.l    0    ;Do not change order!
  2140. TempMove        rs.l    1
  2141. TempSFront        rs.l    1
  2142. TempWFront        rs.l    1
  2143. TempPDef        rs.l    1
  2144. TempRemWin        rs.l    1
  2145. TempMoveMouse        rs.l    1
  2146. TempCXPOPUP        rs.l    1
  2147. TempRestrict        rs.l    1
  2148. TempWBWin        rs.l    1
  2149. TempCXPRI        rs.l    1
  2150. TempCXPOPKEY        rs.l    1
  2151. TempHADJ        rs.l    1
  2152. TempVADJ        rs.l    1
  2153. TempScreen        rs.l    1
  2154. TempWindow        rs.l    1
  2155. TempActionKey        rs.l    1
  2156. TempAction        rs.l    1
  2157. TempDelay        rs.l    1
  2158. TempLWindow        rs.l    1
  2159. TempNWindow        rs.l    1
  2160. TempDummy        rs.l    1
  2161. TempZero        rs.l    1
  2162. TempSave        rs.l    1
  2163.  
  2164. OwnTask            rs.l    1
  2165. Signal            rs.l    1
  2166. Args            rs.l    1
  2167. WBMessage        rs.l    1
  2168. SignalMask        rs.l    1
  2169. MyWindow        rs.l    1
  2170. LastGadget        rs.l    1
  2171. MyIORequest        rs.l    1
  2172. MouseMsgPort        rs.l    1
  2173. MyNewGadget        rs.b    gng_SIZEOF
  2174. MyInterrupt        rs.b    IS_SIZE
  2175. MyInputEvent        rs.b    ie_SIZEOF
  2176. PointerPixEvent        rs.b    IEPointerPixel_SIZEOF
  2177. EasyReqStruct        rs.b    es_SIZEOF
  2178. Description        rs.b    64
  2179. Description2        rs.b    64
  2180. Description3        rs.b    64
  2181. Description4        rs.b    64
  2182. Description5        rs.b    64
  2183. ScreenPatternMem    rs.b    512    ;sufficient I think
  2184. WindowPatternMem    rs.b    512
  2185. AllocLength        rs.w    1
  2186.  
  2187. intuition        dc.b    "intuition.library",0
  2188. DosName            dc.b    "dos.library",0
  2189. InputName        dc.b    "input.device",0
  2190. GraphicsName        dc.b    "graphics.library",0
  2191. IconName        dc.b    "icon.library",0
  2192. GadName            dc.b    "gadtools.library",0
  2193. CommName        dc.b    "commodities.library",0
  2194.             even
  2195.  
  2196. MyNewBroker        dc.b    NB_VERSION    ;Version
  2197.             dc.b    0        ;Reserve1
  2198.             dc.l    HandlerName    ;Name
  2199.             dc.l    PortName    ;Title
  2200.             dc.l    DescText    ;Description
  2201.             dc.w    NBU_NOTIFY!NBU_UNIQUE        ;Unique
  2202.             dc.w    COF_SHOW_HIDE    ;Flags
  2203. MyPri            dc.b    0        ;Pri
  2204.             dc.b    0        ;Reserve2
  2205. BrokerPort        dc.l    0        ;Port
  2206.             dc.w    0        ;ReservedChannel
  2207.  
  2208. CycleList    dc.l    GUI_Choose1.1,GUI_Choose1.2,GUI_Choose1.3,GUI_Choose1.4,0
  2209. CycleList2    dc.l    GUI_Choose2.1,GUI_Choose2.2,GUI_Choose2.3,GUI_Choose2.4,0
  2210. CycleList3    dc.l    GUI_Choose3.1,GUI_Choose3.2,GUI_Choose3.3,0
  2211.  
  2212.         rsreset
  2213. TemplateText    rs.l    1
  2214. TemplateSpecial    rs.l    1
  2215. TemplateA4    rs.w    1
  2216. TemplateType    rs.w    1
  2217. TemplateSize    rs.w    0
  2218.  
  2219. T_CHECK        =    0
  2220. T_CYCLE        =    1
  2221. T_STRING    =    2
  2222. T_INTEGER    =    3
  2223.  
  2224. NumberOfTemps    =    20
  2225.  
  2226. WBTemplate    dc.l    TextDNW,0
  2227.         dc.w    TempDummy,T_CHECK
  2228.  
  2229.         dc.l    TextMove,0
  2230.         dc.w    TempMove,T_CHECK
  2231.  
  2232.         dc.l    TextSFront,0
  2233.         dc.w    TempSFront,T_CHECK
  2234.  
  2235.         dc.l    TextWFront,0
  2236.         dc.w    TempWFront,T_CHECK
  2237.  
  2238.         dc.l    TextPDef,0
  2239.         dc.w    TempPDef,T_CHECK
  2240.  
  2241.         dc.l    TextRestrict,0
  2242.         dc.w    TempRestrict,T_CHECK
  2243.  
  2244.         dc.l    TextDelay,0
  2245.         dc.w    TempDelay,T_INTEGER
  2246.  
  2247.         dc.l    TextAction,CycleList3
  2248.         dc.w    TempAction,T_CYCLE
  2249.  
  2250.         dc.l    TextRemWin,0
  2251.         dc.w    TempRemWin,T_CHECK
  2252.  
  2253.         dc.l    TextMoveMouse,0
  2254.         dc.w    TempMoveMouse,T_CHECK
  2255.  
  2256.         dc.l    TextCXPOPUP,0
  2257.         dc.w    TempCXPOPUP,T_CHECK
  2258.  
  2259.         dc.l    TextWBWin,0
  2260.         dc.w    TempWBWin,T_CHECK
  2261.  
  2262.         dc.l    TextScreen,0
  2263.         dc.w    TempScreen,T_STRING
  2264.  
  2265.         dc.l    TextWindow,0
  2266.         dc.w    TempWindow,T_STRING
  2267.  
  2268.         dc.l    TextCXPOPKEY,0
  2269.         dc.w    TempCXPOPKEY,T_STRING
  2270.  
  2271.         dc.l    TextCXPRI,0
  2272.         dc.w    TempCXPRI,T_INTEGER
  2273.  
  2274.         dc.l    TextHADJ,CycleList
  2275.         dc.w    TempHADJ,T_CYCLE
  2276.  
  2277.         dc.l    TextVADJ,CycleList2
  2278.         dc.w    TempVADJ,T_CYCLE
  2279.  
  2280.         dc.l    TextActionKey,0
  2281.         dc.w    TempActionKey,T_STRING
  2282.  
  2283.         dc.l    TextLastWindow,0
  2284.         dc.w    TempLWindow,T_STRING
  2285.  
  2286.         dc.l    TextNextWindow,0
  2287.         dc.w    TempNWindow,T_STRING
  2288.  
  2289.         dc.l    0
  2290.  
  2291.  
  2292. TextDNW        dc.b    "DONOTWAIT",0
  2293. TextMove    dc.b    "MOVE",0
  2294. TextSFront    dc.b    "SFRONT",0
  2295. TextWFront    dc.b    "WFRONT",0
  2296. TextPDef    dc.b    "DEFPUB",0
  2297. TextCXPOPUP    dc.b    "CX_POPUP",0
  2298. TextRestrict    dc.b    "RESTRICT",0
  2299. TextCXPRI    dc.b    "CX_PRIORITY",0
  2300. TextCXPOPKEY    dc.b    "CX_POPKEY",0
  2301. TextRemWin    dc.b    "REMWIN",0
  2302. TextMoveMouse    dc.b    "MOVEMOUSE",0
  2303. TextHADJ    dc.b    "HADJ",0
  2304. TextVADJ    dc.b    "VADJ",0
  2305. TextScreen    dc.b    "SCREEN",0
  2306. TextWindow    dc.b    "WINDOW",0
  2307. TextActionKey    dc.b    "ACTIONKEY",0
  2308. TextAction    dc.b    "ACTION",0
  2309. TextDelay    dc.b    "DELAY",0
  2310. TextLastWindow    dc.b    "LWINDOW",0
  2311. TextNextWindow    dc.b    "NWINDOW",0
  2312. TextWBWin    dc.b    "WBWIN",0
  2313. Template    dc.b    "MOVE/S,SFRONT/S,WFRONT/S,DEFPUB/S,REMWIN/S,MOVEMOUSE/S,CX_POPUP/S,RESTRICT/S,WBWIN/S,CX_PRIORITY/K,CX_POPKEY/K,HADJ/K,VADJ/K,SCREEN/K,WINDOW/K,ACTIONKEY/K,ACTION/K,DELAY/K,LWINDOW/K,NWINDOW/K",0
  2314. PortName    dc.b    "Huntwindows 3.1",0
  2315. HandlerName    dc.b    "Huntwindows",0
  2316. GadgetText    dc.b    "Ok",0
  2317. DefaultDescr    dc.b    "control alt h",0
  2318. DefaultDescr2    dc.b    "control help",0
  2319. DefaultDescr3    dc.b    "lcommand left",0
  2320. DefaultDescr4    dc.b    "lcommand right",0
  2321. DefaultDescr5    dc.b    "lcommand help",0
  2322. HotKeyErrorT    dc.b    "Wrong hotkey description!",$0a,0
  2323. Text1        dc.b    "Error in arguments or libraries!",$0a,0
  2324. Text2        dc.b    "I need V37+ !",$0a,0
  2325. Text3        dc.b    "Error in given patterns!",$0a,0
  2326. Text4        dc.b    "Cannot Save!",$0a,0
  2327.         dc.b    "$VER: "    ;for version information
  2328. Texth        dc.b    "Huntwindows 3.1 (14.6.93) by Jörg Bublath 1992-1993",0
  2329. DescText    dc.b    "Moves screen to show windows",0
  2330. GUI_Text1    dc.b    "Move Screen",0
  2331. GUI_Text2    dc.b    "ScreenToFront",0
  2332. GUI_Text3    dc.b    "WindowToFront",0
  2333. GUI_Text5    dc.b    "Set Default PubScreen",0
  2334. GUI_Text6    dc.b    "Restrict on DefPub",0
  2335. GUI_Text7    dc.b    "Remember Window",0
  2336. GUI_Text7_1    dc.b    "Move Mouse",0
  2337. GUI_Text7_2    dc.b    "GUI Popup",0
  2338. GUI_Text8    dc.b    "Horizontal Adjustment",0
  2339. GUI_Text9    dc.b    "Vertical Adjustment",0
  2340. GUI_Text10    dc.b    "_Hide",0
  2341. GUI_Text11    dc.b    "_Quit",0
  2342. GUI_Text12    dc.b    "Screen Pattern",0
  2343. GUI_Text13    dc.b    "Window Pattern",0
  2344. GUI_Text14    dc.b    "_Save",0
  2345. GUI_Text16    dc.b    "Popup Hotkey",0
  2346. GUI_Text17    dc.b    "Action Hotkey",0
  2347. GUI_Text18    dc.b    "Action Condition",0
  2348. GUI_Text19    dc.b    "'Last Window' Hotkey",0
  2349. GUI_Text19_2    dc.b    "'Next Window' Hotkey",0
  2350. GUI_Text20    dc.b    "Exclude WB-Windows",0
  2351. SliderText    dc.b    "Delay in 1/50 seconds:%ld  ",0
  2352. GUI_TextEnd    ;
  2353. GUI_Choose1.1    dc.b    "left",0
  2354. GUI_Choose1.2    dc.b    "right",0
  2355. GUI_Choose1.3    dc.b    "center",0
  2356. GUI_Choose1.4    dc.b    "off",0
  2357. GUI_Choose2.1    dc.b    "top",0
  2358. GUI_Choose2.2    dc.b    "bottom",0
  2359. GUI_Choose2.3    dc.b    "center",0
  2360. GUI_Choose2.4    dc.b    "off",0
  2361. GUI_Choose3.1    dc.b    "necessary",0
  2362. GUI_Choose3.2    dc.b    "hotkey",0
  2363. GUI_Choose3.3    dc.b    "always",0
  2364.         even
  2365.